package org.example.myframework.frame.demo.designPattern.filterPattern;

public enum ArticleFilterEnum {
    WORD_COUNT(1, "word_count");

    private int code;
    private String desc;

    ArticleFilterEnum(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static ArticleFilterEnum getByCode(int code) {
        for (ArticleFilterEnum articleFilterEnum : ArticleFilterEnum.values()) {
            if (articleFilterEnum.code == code) {
                return articleFilterEnum;
            }
        }
        return null;
    }

}
